package com.xm.xmwa1706090.startup;

import com.xm.xmwa1706090.service.netty.DeviceTCPServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 杭州新苗网络科技有限公司
 * @author meihf
 * @date 2017/06/14
 * @description
 */
public class StartupService {

    static Logger logger = LoggerFactory.getLogger(StartupService.class);

    public static void main(String[] args) throws Exception {

//        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring/application-context.xml");
//        DeviceTCPServer server = ctx.getBean(DeviceTCPServer.class);
//        server.bind(8989,200);

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring/application-context.xml"});
        context.start();
        logger.info("★★★★★★xmwa1706090-service服务启动成功★★★★★★");
        System.out.println("★★★★★★xmwa1706090-service服务启动成功★★★★★★");
        synchronized (StartupService.class)
        {
            while (true)
                try
                {
                    StartupService.class.wait();
                }
                catch (Throwable e) {
                    e.printStackTrace();
                }
        }

    }

}
